package club.gskj.gulimall.order.feign;

import club.gskj.common.utils.R;
import club.gskj.gulimall.order.vo.WareSkuLockVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("gulimall-ware")
public interface WareFeignService {

    /**
     * @param skuIds
     * @return club.gskj.common.utils.R
     * @author 康纳-connor
     * @creed: Talk is cheap,show me the code
     * @date 21.2.10 17:19
     * @Description 查询 sku是否保存库存
     */
    @PostMapping("ware/waresku/hasstock")
    public R hasStockBySku(@RequestBody List<Long> skuIds);

    /***
     *   根据地址获取对应的 运费信息
     * @param addrId 地址id
     */
    @GetMapping("ware/wareinfo/freight")
    public R getFreightById(@RequestParam("addrId") Long addrId);

    /***
     *  订单锁定库存
     * @return
     */
    @PostMapping("ware/waresku/order/lock")
    public R orderLockStock(@RequestBody WareSkuLockVo wareSkuLockVo);
}
